package cn.bdqn.service;

import cn.bdqn.domain.Cargo;
import cn.bdqn.utils.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author dkj
 */
@Service
@FeignClient(name = "lms-cargo",fallback = CargoService.class)
public interface CargoService {


    /**
     * 根据主键id查询
     * @param id
     * @return
     */
    @GetMapping(value = "/cargo/queryByPrimaryKey/{id}")
    public Result queryByPrimaryKey(@PathVariable("id") Integer id);

    /**
     * 多条件查询   分页
     * @param cargo
     * @return
     */
    @GetMapping(value = "/cargo/queryByCargo/cargo/pageNum/{pageNum}/pageAmount/{pageAmount}")
    public Result queryByCargo(@RequestBody Cargo cargo, @PathVariable("pageNum") Integer pageNum, @PathVariable("pageAmount") Integer pageAmount);

    /**
     * 新增
     * @param cargo
     */
    @RequestMapping(value = "/cargo/insert/cargo")
    public Result insert(Cargo cargo);

    /**
     * 选择更新
     * @param cargo
     */
    @RequestMapping(value = "/cargo/updateByPrimaryKeySelective/cargo")
    public Result updateByPrimaryKeySelective(Cargo cargo);


}
